ποΈGitΠ―ΡΠ°ποΈ
feature/car/TESTING.md fix/fdroid-map-rendering (113121c4) Text, 2.82 KB
Testing the Car (Android Auto) feature
Two ways to verify T383838feature:car. Use the unit tests for correctness; use the DHU only when you
want to eyeball the real in-car experience end to end.
1. Automated β T383838SessionController tests (no hardware, runs in CI)
T282828
./gradlew :feature:car:testGoogleDebugUnitTest
T383838CarScreensTest drives the real T383838HomeScreen through the androidx.car.app testing context, pushing
state via the T383838CarStateCoordinator test seam (T383838setStateForTest), and asserts the right template
renders per connection state plus the T383838ALERT_APP β emergency flow. This is what catches regressions
(e.g. it caught the T383838TabTemplate.setActiveTabContentId crash the 1.7.0 pin introduced). Robolectric
is pinned to T383838@Config(sdk = [36]) because no Robolectric SDK-37 sandbox exists yet β harmless, the
templates are SDK-agnostic.
2. Visual β Desktop Head Unit (DHU)
Platform matters
DHU decodes an H.264 video stream from the phone. **macOS Apple Silicon (T3838382.1-mac-arm64) fails at
this step** β it connects and reports T383838Has video focus: true but renders no frames. Use an
x86_64 Linux (or Windows) host; T383838linux-arm64 DHU does not exist, and an emulated x86 VM has no
hardware decode (same failure). A VM is fine only on an x86_64 host with real virtualization.
Phone prep (one time)
1. Settings β About β tap Build number Γ7 β enable USB debugging and Wireless debugging.
2. Open Android Auto settings (on a Pixel: T383838adb shell am start -n com.google.android.projection.gearhead/.companion.settings.DefaultSettingsActivity),
tap Version ~10Γ to unlock Developer settings, then enable Start head unit server.
On the x86_64 box
T282828
sdkmanager Ta5d6ff"extras;google;auto" T8b949e# installs the linux-x86_64 DHU
T8b949e# Connect to the phone over wifi (no re-plugging; works even if the phone lives on another machine):
adb pair <phone-ip>:<pair-port> T8b949e# one-time; code shown under Wireless debugging
adb connect <phone-ip>:<debug-port>
adb forward tcp:5277 tcp:5277
Tffa657cd Ta5d6ff"Te6edf3$ANDROID_SDK_ROOTTa5d6ff/extras/google/autoTa5d6ff" Tff7b72&& ./desktop-head-unit
DHU commands: type T383838help in its shell; T383838focus video, T383838tap <x> <y>, T383838screenshot <file>.
Caveat: our app has no car-launcher tile
T383838feature:car is a MESSAGING-category app. It does not appear as an icon on the Android Auto
home β it surfaces when a message notification arrives. To see the T383838ConversationItem UI in the
DHU you must have a paired Meshtastic radio sending a text; the notification (read-aloud + reply)
is the entry point. Without a radio you'll see the AA home, not our screens. (For the same reason,
the AAOS emulator is not a fit either: messaging isn't an AAOS distribution category, and the app is
projection-only β no T383838CarAppActivity.)
Served by rngit 1.5.0 - Generated in 0.03s